import { ArrayMaxSize, IsArray, IsBoolean, IsInt, IsNotEmpty, IsOptional, IsString, Max, MaxLength, Min } from "class-validator";

export default class CreateDto{
    @MaxLength(30)
    @IsString()
    name:string;

    @MaxLength(20)
    @IsNotEmpty()
    @IsString()
    code:string;

    @MaxLength(100)
    @IsString()
    @IsOptional()
    icon:string;

    @Min(0)
    @IsInt()
    parentId: number;

    @Min(0)
    @IsInt()
    sort: number;

    @MaxLength(15)
    @IsNotEmpty()
    @IsString()
    aliProduct:string;

    @IsBoolean()
    @IsOptional()
    enable:boolean;

    @ArrayMaxSize(50)
    @IsArray()
    @IsOptional()
    paramFields:number[];
}